package com.godyao.mall.feign.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;

/**
 * 获取当前请求上下文的HttpServletRequest
 * @author godyao
 */
//public class RequestContextUtils {
//    /**
//     * 获取HttpServletRequest
//     */
//    public static HttpServletRequest getRequest(){
//        return ((ServletRequestAttributes)(Objects.requireNonNull(RequestContextHolder.getRequestAttributes()))).getRequest();
//    }
//}
